﻿/* EntitiesToDTOs. Copyright (c) 2011. Fabian Fernandez.
 * http://entitiestodtos.codeplex.com
 * Licensed by Common Development and Distribution License (CDDL).
 * http://entitiestodtos.codeplex.com/license
 * Fabian Fernandez. 
 * http://www.linkedin.com/in/fabianfernandezb/en
 * */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EntitiesToDTOs.Properties;

namespace EntitiesToDTOs.Domain
{
    /// <summary>
    /// Represents a Warning raised by this AddIn
    /// </summary>
    internal class Warning
    {
        /// <summary>
        /// Warning Message
        /// </summary>
        public string Message { get; private set; }

        /// <summary>
        /// Warning Message (shortened if it is too long)
        /// </summary>
        public string ShortMessage { get; private set; }


        public Warning(string message)
        {
            this.Message = message;
            this.ShortMessage = this.Message;

            if (this.ShortMessage.Length > 120)
            {
                this.ShortMessage = this.ShortMessage.Remove(117);
                this.ShortMessage += Resources.Text_WarningMessageShortenedTail;
            }
        }
    }
}
